﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:u="clr-namespace:PropertyGrid"
	>

	<!-- PropertyGridLabel-->
	<Style TargetType="u:PropertyGridLabel">
		<Setter Property="IsEnabled" Value="true" />
		<Setter Property="HorizontalAlignment" Value="Stretch" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="Cursor" Value="Arrow" />
		<Setter Property="Margin" Value="0" />
		<Setter Property="BorderThickness" Value="0" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="u:PropertyGridLabel">
					<Border Background="{TemplateBinding Background}" HorizontalAlignment="Stretch">
						<ContentControl  
									ContentTemplate="{TemplateBinding ContentTemplate}" 
									Cursor="{TemplateBinding Cursor}" 
									HorizontalAlignment ="Stretch"
									HorizontalContentAlignment="Stretch" 
									FontFamily="Arial Narrow" 
									FontSize="{TemplateBinding FontSize}" 
									FontStretch="{TemplateBinding FontStretch}" 
									Foreground="{TemplateBinding Foreground}" 
									Margin="5,0,0,0" 
									VerticalAlignment="Center"
									VerticalContentAlignment="Center">
							<ContentPresenter Content="{TemplateBinding Content}"/>
						</ContentControl>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- PropertyGrid -->
	<Style TargetType="u:PropertyGrid">
		<Setter Property="HorizontalAlignment" Value="Stretch" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Stretch" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="u:PropertyGrid">
					<ScrollViewer x:Name="LayoutRoot"
									Margin="0"
									Padding="0"
									BorderBrush="{TemplateBinding GridBorderBrush}"
									BorderThickness="{TemplateBinding GridBorderThickness}"
									HorizontalAlignment="Stretch"
									VerticalAlignment="Stretch"
									HorizontalContentAlignment="Stretch"
									VerticalContentAlignment="Stretch"
									HorizontalScrollBarVisibility="Disabled"
									VerticalScrollBarVisibility="Auto"
									>
						<Grid x:Name="MainGrid" VerticalAlignment="Top">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="16"/>
								<ColumnDefinition Width="{TemplateBinding DefaultLabelWidth}" MinWidth="50"/>
								<ColumnDefinition/>
							</Grid.ColumnDefinitions>
						</Grid>
					</ScrollViewer>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>